home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / batch / ebl / batdoc2.bat < prev   
DOS Batch File  |  1990-02-28  |  31KB  |  838 lines

  1. bat * Loading HELP and DOCUMENTATION part 2
  2.  
  3. *           Written by F.Canova 10/5/83 through 01/15/90
  4. *   (c) Copyright 1983 to 1990 by Seaware Corp. all rights reserved.
  5. *    This batch file REQUIRES EBL PLUS for proper execution!
  6.  
  7.          **** NOTE! NOTE! NOTE! NOTE! ****
  8.  RAM    |* <-----Change 'RAM' to 'BIOS' if PC isn't 100% IBM Compatible!
  9.  
  10.  if %G = .goto. then %G = | goto -%F
  11.  beep type Error! Begin by using BATDOC first!
  12.  type This file is an overlay to BATDOC.
  13.  exit
  14.  
  15. -opt0     %F = opt0     | skip 3
  16. -line0     %F = line0    | skip 2
  17. -line599  %F = line599 | skip 1
  18. -line1405 %F = line1405
  19.     %G = .goto.
  20.     color 8f |type Loading part 1 ...
  21.     leave
  22.     batdoc
  23.  
  24. -header * Routine prints general purpose header for help text
  25.     stack.purge            |*  remove any pre-typed keystrokes.
  26.     %n = %i $ 1 ( %i # - 2 ) & . & ( %i $ ( %i # - 1 ) 2 ) |* extract section # from page #
  27.     color( white on black )
  28.     cls
  29.     color( white on cyan  )
  30.     window( 1, 1, 79, 3, Combo)
  31.     begtype
  32.  \%H                     Page \%n
  33.  
  34. \07    Press:  PGDN for next page,   PGUP for prev page,  HOME for main menu.
  35. end
  36.     color( white on black)
  37.     colorchar ~ as color(yellow on black)
  38.     window( 1, 5, 79, 25, Combo)
  39.     return
  40.  
  41. -scroll * Routine accepts key for scrolling help text
  42.     %e = 0
  43.     inkey %k
  44.     if %k = KEY("Ctrl-C") then goto -opt0
  45.     if %k = KEY(Esc)  %i = 0      | goto -line0
  46.     if %k = KEY(Home) %i = 0      | goto -line0
  47.     if %k = KEY(Pgup) %i = %i - 1 | cls | %F = line%i | goto -%F
  48.     if %k = KEY(Pgdn) %i = %i + 1 | cls | %F = line%i | goto -%F
  49.     goto -scroll |* ignore any other key.
  50.  
  51.     * ROUTINE TO HAVE USER GIVE A COMMAND A TRY !!
  52.     * %A = string which must match
  53. -tryit
  54.     begtype
  55.  
  56.   Enter your guess!  ;
  57. end
  58. -tryit.loop
  59.     if .%a = . goto -tryit.solved.it |* end of string ?
  60.     %b = %a $ 1 1        |* get 1st letter
  61.     %a = %a $ 2        |* remove it from string
  62. -tryit.retry
  63.     inkey %k          |* get a key.
  64.     if %k = KEY(" ") type %b; | goto -tryit.loop
  65.     if %k = KEY(ESC) type %b%a| goto -tryit.give.up
  66.     if %k = %b type %k;      | goto -tryit.loop
  67.     beep goto -tryit.retry
  68.  
  69. -tryit.solved.it
  70.     begtype
  71.  
  72.  
  73. EXCELLENT !! - that's exactly it!
  74.  
  75. end
  76.     read Press the ─┘ key to continue to next section.....
  77.     return
  78.  
  79. -tryit.give.up
  80.     begtype
  81.  
  82. That's the answer you needed! (You can "peek" at part of
  83. the answer next time by pressing the space bar if you'd like.)
  84.  
  85. end
  86.     read Press the ─┘ key to continue to next section.....
  87.     return
  88.  
  89. -opt6
  90. -line503 %i = 600
  91. -line600 %H = "How to print" | call -header| begtype
  92.  
  93.   The simplest thing to for Extended Batch Language to do is to print text
  94. on the display.  This is done by either of two commands, TYPE and BEGTYPE.
  95.  
  96.   The TYPE command can be used for something as simple as saying hello!
  97. For example:
  98.  
  99.     TYPE "HELLO THERE"
  100.  
  101.   This is all that is needed.  This command can be typed directly from DOS
  102. (this is called immediate mode) or be entered into a file such as
  103. "TRIAL.BAT" (this is called direct execution mode).  To execute it as a BAT
  104. program with the file, just type the file's name "TRIAL" from DOS and you
  105. will see the results of the program "HELLO THERE" coming from BAT.
  106. end
  107.     goto -scroll
  108. -line601 call -header | begtype
  109.  
  110.   You can also put DOS variables into this command to display their
  111. contents.  For example, if the "TRIAL.BAT" file contained the line:
  112.  
  113.     TYPE "HELLO THERE" %1 %2
  114.  
  115.   Then when we start the BAT program from DOS, we might enter:
  116.  
  117.     TRIAL COMPUTER USER
  118.  
  119.   DOS will automatically store the words after the program name into its
  120. variables.  Therefore, in the TYPE command, we will see contents of these
  121. variables on the screen.  The resulting message would be:
  122.  
  123.     HELLO THERE COMPUTER USER
  124. end
  125.     goto -scroll
  126. -line602 call -header | begtype
  127.  
  128.   There is a second method of putting text onto the display.  This is with
  129. the BEGTYPE command.  Although it will not display the contents of
  130. variables, it is very useful for displaying large blocks of text, such as
  131. menus.    For example, if the "TRIAL.BAT" file contains:
  132.  
  133.     BAT BEGTYPE
  134.     This is a large block of text. It is useful for menus. Note
  135.     that Upper/Lower case characters are displayed intact here.
  136.     The block is always ended with "END" in the first column
  137.     after the text finishes.
  138.     END
  139.  
  140.   When executed, the "TRIAL.BAT" program will display:
  141.  
  142.     This is a large block of text. It is useful for menus. Note
  143.     that Upper/Lower case characters are displayed intact here.
  144.     The block is always ended with "END" in the first column
  145.     after the text finishes.
  146. end
  147.     goto -scroll
  148. -line699 %i = 603
  149. -line603 call -header | begtype
  150.  
  151.   There is an additional advantage to using BEGTYPE command.  This command
  152. can also highlight text to the user.  This is done by using the form:
  153. [\\hex] within the text block.
  154.  
  155.   For example if the text block contained \\0F within the text, the result
  156. would be ~ High Intensity Text !  ~.
  157.  
  158.   By choosing different values, the screen attributes can be controlled to
  159. create inverted video, blinking, underlined, and very colorful text.
  160.  
  161.   You can also display the contents of variables by using [\\%Var.name] in
  162. the text block. For instance, if the variable %0 is to be printed, use \\%0
  163. within the text after the BEGTYPE command.
  164.  
  165.   An additional command CLS can be used to clear the display before
  166. printing data.    For instance, the combination "BAT CLS BEGTYPE" is quite
  167. useful for printing menus and text such as this screen.
  168. end
  169.     goto -scroll
  170. -line604
  171.     begtype
  172.  
  173.     ~NOW IT'S YOUR TURN !!!~
  174.  
  175.  
  176. If the ~%4~ variable contains the word ~DAY~, what is the command to display
  177. the words "~FUN DAY~" on the display?
  178.  
  179. end
  180.      %A = "TYPE FUN %4" | Call -tryit
  181. -opt7
  182. -line605  %i = 700
  183. -line700 %H = "Reading things from user" | call -header | begtype
  184.   In order to get input from the user, there are two available commands,
  185. READ and INKEY.
  186.  
  187.   When the command word READ is seen in the batch file, an input line is
  188. accepted from the user.  All function keys are assigned to the normal DOS
  189. edit functions.  When ENTER is pressed, the input line is assigned to DOS
  190. variables.
  191.  
  192.   Each word will be assigned in order to the variables indicated after the
  193. READ command.  When there are no more variables after the READ command to
  194. assign, the remainder of the response is thrown away.  If there are more
  195. variables to be assigned after the READ command than there are words from
  196. the user, these variables will be cleared out to a empty state.  For
  197. example:
  198.  
  199.     READ Please enter your name ==> %1 %2
  200.  
  201.   This would prompt the user and wait for him to enter two words.  These
  202. words will be saved in the %1 and %2 variables.
  203. end
  204.      goto -scroll
  205. -line701 call -header | begtype
  206.  
  207.   Note that there does not have to be any variables indicated after the
  208. command READ.  In this case, EBL would wait for the enter key, throw away
  209. any response, then continue to process the next batch file command.
  210.  
  211. end
  212.     goto -scroll
  213. -line702 call -header | begtype
  214.  
  215.   In the event that you wish to get a single keystroke from the user, the
  216. INKEY command should be used.
  217.  
  218.   This command will wait for the user to enter a single key on the keyboard
  219. and return its value in the optional variable.    This key can be not only
  220. letters, but all function keys, control keys, etc.  For example:
  221.  
  222.     INKEY Press any key to continue... %0
  223.  
  224.   When the user presses a single key, that key is saved into the variable %0.
  225.  
  226.   If the key that is pressed is in the range of "!" to "z" (decimal 33 to
  227. 122) then the key saved to the optional variable. If you wish this key to be
  228. echoed to the display, you must specifically use the TYPE command.
  229.  
  230. end
  231.      goto -scroll
  232. -line799 %i = 703
  233. -line703 call -header | begtype
  234.  
  235.   If the key is not in the above range, then the key will be converted to
  236. the form "KEYxxx" where xxx is the hex value of the key.  Extended key
  237. codes will be in the range KEY100 to KEY1FF and nonextended key codes will
  238. be in the range KEY000 to KEY0FF.  Refer to Appendix G of the Basic manual
  239. for a complete description of the various assignments of key codes.
  240.  
  241.   The character does not have to be assigned to a variable.  If the
  242. variable name is not present following the command INKEY, the system will
  243. wait for any key to be pressed from the user, and then continue processing.
  244.  
  245. end
  246.     goto -scroll
  247. -line704
  248.     begtype
  249.  
  250.     ~NOW IT'S YOUR TURN !!!~
  251.  
  252.  
  253.   We wish to create a menu with several options.  At a "~=>~" prompt,
  254. the user must enter a~single letter~to select his option.  What is
  255. the command needed to request a single keystroke into the ~%4~
  256. variable for option selection using the prompt above?
  257.  
  258. end
  259.      %A = "INKEY => %4" | call -tryit
  260. -opt8     %i = 800
  261. -line800 %H = "Program Control" | call -header| begtype
  262.   There are several ways of controlling the order of execution of a program
  263. written with Extended Batch Language.  GOTO, CALL, RETURN, and IF are all
  264. commands that do this.    The simplest is the GOTO command:
  265.  
  266.     GOTO -LABEL
  267.  
  268.   If this line is put into a ".BAT" file, then it will stop execution at
  269. this line and resume at the line within the file which contains:
  270.  
  271.     -LABEL
  272.  
  273.   This is a unconditional branch.  If the label is not present within the
  274. file, and error will result.  Note the minus (-) sign before the label
  275. name. ~Labels must be preceded with a minus sign.~ This is done so
  276. that EBL can tell the difference between a label and a command within the
  277. language.
  278. end
  279.     goto -scroll
  280. -line801 call -header | begtype
  281.  
  282.    A CALL command is similar to a GOTO command.  The primary difference is
  283. that the line where the CALL command was is saved away.  Then a branch to a
  284. label is done, just like the GOTO command.  Note that the CALL command can
  285. be nested up to 31 levels.  When a RETURN command is found, the last line
  286. that was saved is now restored.  Execution resumes at the line following
  287. the original CALL command.
  288.  
  289. end
  290.     goto -scroll
  291. -line802 call -header | begtype
  292. For example, if a program contains:
  293.  
  294.         TYPE One
  295.        ~CALL -LABEL~
  296.        ~CALL -LABEL~
  297.         TYPE Four
  298.         EXIT
  299.     -LABEL
  300.         TYPE Two
  301.         TYPE Three
  302.        ~RETURN~
  303.  
  304.   You will see on the display:
  305.     One
  306.     Two
  307.     Three
  308.     Two
  309.     Three
  310.     Four
  311. end
  312.     goto -scroll
  313. -line803 call -header | begtype
  314.   The final way to control the flow of an Extended Batch Language program
  315. is to use an IF command.  The general form of this command is:
  316.  
  317.     IF _word_   _condition_   _word_   _operation_______
  318.  
  319.  
  320.   Each word can be a fixed string of letters, or a variable, or a
  321. combination of each.
  322.  
  323.   The conditions can be:
  324.  
  325.     <    less than
  326.     >    greater than
  327.     <>    not equal to
  328.     =    equal to (case insensitive)
  329.     ==    exactly equal to (case sensitive)
  330.  
  331.   The operation can be any of the Extended Batch Language commands.
  332. end
  333.      goto -scroll
  334. -line899 %i = 804
  335. -line804 call -header | begtype
  336.   For example, all of the following IF statements will compare correctly
  337. and execute their corresponding TYPE command.  The first two statements
  338. will initialize variables used in the IF commands.
  339.  
  340.     %1 = ABC
  341.     %2 =
  342.  
  343.     IF ABC = %1  TYPE The variable contains ABC.
  344.     IF %1 = abc  TYPE This also matches.
  345.     IF 0 <> 00   TYPE These are different lengths.
  346.     IF 0 < 00    TYPE 0 has a smaller length.
  347.     IF 456 > 123 TYPE Numerically, 456 is bigger.
  348.     IF 456 < %1  TYPE ASCII value of 456 is smaller.
  349.     IF AABCD = A%1D TYPE Token substitutions are made.
  350.     IF %2 <> %1  TYPE Variables are different lengths.
  351.     IF .%2 = .   TYPE This matches if var is empty.
  352.     IF BOX = BOX IF DOG <> CAT TYPE Did multi-if compare.
  353.     IF 1 + 2 = 3 TYPE Arithmetic results match.
  354. end
  355.     goto -scroll
  356. -line805
  357.     begtype
  358.  
  359.        ~NOW IT'S YOUR TURN !!!~
  360.  
  361.  
  362.   We wish to make a series of tests on a menu option that a user entered.
  363. It is saved in the variable~%4~.  What command is needed to test for
  364. the letter "~A~"?
  365.  
  366. end
  367.      %A = "IF %4 = A" | call -tryit
  368. -opt9     %i = 900
  369. -line900 %H = "KEYBOARD STACK" | call -header| begtype
  370.   There is a method within the EBL language for answering questions from
  371. programs without operator intervention.  This is done by a "keyboard
  372. stack".  By entering data into the stack, you will essentially be entering
  373. data through your keyboard when any program requests it.  In this way, a
  374. batch file can now answer questions programs may have by 'typing' them for
  375. the user.
  376.  
  377.   The keyboard stack operates in a "first-in first-out" basis.  That is,
  378. the first line of text put into the stack will be the first seen by the
  379. program when it reads the keyboard.  The second line entered will be the
  380. second seen by the program, and so on.    As long as there is text remaining
  381. on the stack, ALL requests for data from the keyboard will actually come
  382. from the stack.  Once the stack has been emptied by the program, data will
  383. then come from the keyboard as usual.
  384.  
  385.   There are two commands which store data into the stack, STACK and
  386. BEGSTACK. Here's some more about them.....
  387. end
  388.      goto -scroll
  389. -line901 call -header | begtype
  390.   The STACK command is very much like the previously mentioned TYPE
  391. command.  Instead of displaying to the screen, it will "push" data into the
  392. keyboard stack area.  When any program is ready to accept information from
  393. the keyboard, the parameters after the STACK command will be used as input.
  394. For example:
  395.  
  396.     * This program will issue remarks to DOS.
  397.     %1 = HELLO
  398.     STACK REM THIS IS A REMARK FOR DOS
  399.     STACK REM VARIABLE %%1 = %1
  400.  
  401. When executed, the following will appear on the screen:
  402.  
  403.     A>REM THIS IS A REMARK FOR DOS
  404.  
  405.     A>REM VARIABLE %1 = HELLO
  406. end
  407.      goto -scroll
  408. -line902 call -header | begtype
  409.   The second command used to stack data is BEGSTACK.  This command is
  410. equivalent to BEGTYPE previously described.  It is useful for dumping large
  411. amounts of data to the stack area.  Although no parameter substitution is
  412. performed, there are several advantages to its use.
  413.  
  414.   First, if a line ends with the ";" (semicolon) character, a carriage
  415. return will NOT be stacked.  Second, if "\\HEX" is used where HEX is a
  416.  
  417. number from 01 to FE, then this exact keyboard value will be stacked.  This
  418. is useful for stacking special control characters and symbols.    Third, if
  419. "\\00\\HEX" is used, an extended key code will be stacked.  This is useful
  420. for stacking function keys and the like.  Refer to the Basic manual in
  421. Appendix G under "Extended Codes".  Fourth, if \\FF\\HEX is used, the stack
  422. will delay the keyboard characters from appearing to the program for HEX
  423. number of CPU "ticks".  There are about 12 hex (18 decimal) ticks per
  424. second in the CPU.  In all cases, the word HEX above represents a two digit
  425. hexadecimal number. Finally, \\\\ can be used to stack a single backslash.
  426.  
  427. Some examples...
  428. end
  429.      goto -scroll
  430. -line903 call -header | begtype
  431. Some examples of BEGSTACK command::
  432.  
  433.     BEGSTACK
  434.     \\09 Will stack the tab key.
  435.     This text will be stacked ; 
  436.         on one line!
  437.     \\00\\3B Will stack an F1 key.
  438.     \\\\ is seen as one backslash.
  439.     \\FF\\24 will pause two seconds.
  440.     END
  441.  
  442.  
  443. Hint: Some programs remove keystrokes before accepting a critical key. In
  444. some cases this can be avoided by using \\FF\\01 in the BEGSTACK command.
  445. end
  446.      goto -scroll
  447. -line904 call -header | begtype
  448. Note that in the above examples, the STACK or BEGSTACK commands always are
  449. ~before~ the command or program that will be using the keystrokes. An
  450. example of this order is:
  451.  
  452.     BEGSTACK
  453.     <<keystroke values needed by the program>>
  454.     END
  455.     <<program that will be controlled by the stack>>
  456.  
  457. An example of using the stack with the COPY command within DOS would be:
  458.  
  459.     BEGSTACK
  460.     This text will be given to the copy command.
  461.     \\00\\3B An F1 key ends the copy.
  462.     END
  463.     COPY CON: result.txt
  464.  
  465. end
  466.      goto -scroll
  467. -line905 call -header | begtype
  468. There are also three control commands which are associated with the stack:
  469.  
  470. STACK.OFF     - Redirects data to come directly from
  471.         the physical keyboard. Does not remove
  472.         any data in the stack.
  473.  
  474. STACK.ON      - Directs data to come from the stack.
  475.         This is the default.
  476.  
  477. STACK.PURGE   - Removes any data from the stack and
  478.         keyboard buffers which are pending.
  479. end
  480.     goto -scroll
  481. -line999 %i = 906
  482. -line906
  483.     begtype
  484.  
  485.        ~NOW IT'S YOUR TURN !!!~
  486.  
  487.  
  488.   From our menu, we wish to start up a communications program and
  489. automatically dial a phone number with a smartmodem.  The communications
  490. program we have will take what is typed on the keyboard and send it to the
  491. modem.    The command needed for the modem to dial our phone is
  492. "~ATD12~" .  What Extended Batch Language command will force the
  493. communication program to dial this modem command?
  494.  
  495. end
  496.     %A = "STACK ATD12" | call -tryit
  497. -opt10    %i = 1000
  498. -line1000 %H = "GETTING RESULTS!" | call -header | begtype
  499.   The results of programs often need to be known so that some action can
  500. take place after the program ends.
  501.  
  502.   When the command word READSCRN is seen in the batch file, a line of text
  503. is read from the display screen into variables.  Having the ability to read
  504. text from the display can be useful for determining the result of another
  505. program, or making a query for some system status which would not normally
  506. be available within a batch file.  For example, by reading a directory from
  507. the screen, a series of files can be submitted to the macro assembler.
  508. Once the assembly is completed, the status can be read from the screen to
  509. determine if there were errors which would stop the link step.    Virtually
  510. any message which a program can generate can be used as feedback to a batch
  511. file by using READSCRN.
  512. end
  513.       goto -scroll
  514. -line1001 call -header | begtype
  515.   Its operation is very much like the READ command except for the fact that
  516. the information which is being read is coming from the display screen and
  517. not the keyboard.  Like the READ command, the text from the screen is
  518. tokenized (separated at word boundaries and assigned to variables).  The
  519. return code %R will be reflect the line number on the display that was
  520. read.  This number will be in the range of 1 to 25 for the top to bottom
  521. lines respectively. Once a line is read, this command will be set to read
  522. the previous line. Repeated READSCRN commands will read UP the display!
  523.  
  524. For example:
  525.     CLS
  526.     TYPE HELLO THERE
  527.     READSCRN %A %B %C
  528.  
  529. After execution:
  530.     %A contains HELLO
  531.     %B contains THERE
  532.     %C contains nothing, it is empty.
  533.     %R (return code) contains 1, the line number that was read.
  534. end
  535.       goto -scroll
  536. -line1099 %i = 1002
  537. -line1002
  538.     begtype
  539.  
  540.        ~NOW IT'S YOUR TURN !!!~
  541.  
  542.  
  543.   From our menu, we have started the IBM Macro Assembler program.  We know
  544. that when this program ends, it will display a number representing the
  545. number of errors that were found.  We want to make sure that this number is
  546. zero before continuing to the LINK program.  If we save this number in the
  547. variable~%A~, what is the command to read the assembler result from
  548. the display?
  549.  
  550. end
  551.       %A = "READSCRN %A" | call -tryit
  552. -opt11      %i = 1100
  553. -line1100 %H = ASSIGNMENTS     | call -header| begtype
  554.   If the first character in the command is a '%' (Percent sign), then it is
  555. considered to be an assignment statement.  The first variable cannot be any
  556. predefined variable (such as %R or %%), but may be any of the other
  557. variables %0 to %9 and %A to %O.  If a DOS command is later executed and
  558. uses one of the variables %0 to %9, it will be properly replaced with the
  559. contents of that variable.
  560.  
  561. The first assignment token, the operator, and the final tokens are optional.
  562. The assignment statement must appear in one of the following forms:
  563.  
  564. ~[var] =                      ~- create empty variable
  565. ~[var] = [string]          ~- simple assignment
  566. ~[var] = [number] + [number]  ~- addition
  567. ~[var] = [number] - [number]  ~- subtraction
  568. ~[var] = [number] * [number]  ~- multiplication
  569. ~[var] = [number] / [number]  ~- division
  570. ~[var] = [string] #          ~- string length
  571. ~[var] = [string] $ [index] [length] ~- create substring (like MID$ in BASIC)
  572. end
  573.     goto -scroll
  574. -line1199 %i = 1101
  575. -line1101 call -header | begtype
  576.  ~[var]~ - A DOS variable or global user variable %0 to %9 and %A to
  577. %O.  It may not be a predefined variable.
  578.  
  579.  ~[string]~ - Any valid token.    Letters, numbers, any variable, or any
  580. combination there of.  123, ABC, and 987%J4SF are all valid strings.
  581.  
  582.   ~[number]~ - Any token with a numeric result in the range of ± 2**64.
  583. For example (if %A contains 34) the three numbers 98, %A, and 12%A5
  584. (equivalent to 12345) would all be valid numbers.
  585.  
  586.   ~[index]~ - Same restrictions as [number] above except that an
  587. [index] above 16 is meaningless and is equivalent to the number 16.
  588.  
  589.   ~[length]~ - Same restrictions as [number] above except that a
  590. [length] above 15 is meaningless and is equivalent to the number 15.  Note
  591. that [length] is optional and has a default value of 15.
  592.  
  593. end
  594.     goto -scroll
  595. -line1102
  596.     begtype
  597.  
  598.        ~NOW IT'S YOUR TURN !!!~
  599.  
  600.  
  601.   We wish to count the number of times that a user has used a certain .BAT
  602. program.  We will keep this count in the global user variable~%A~
  603. which will stay active even BETWEEN batch file execution.  What is the
  604. command needed to increase the value in this variable by one?
  605.  
  606. end
  607.     %A = "%A = %A + 1" | call -tryit
  608. -opt12
  609. -line1103
  610. -line1299 %i = 1200
  611. -line1200 %H = "DEBUGGING AIDS" | call -header| begtype
  612. As an aid in debugging, the TRACE(ALL) function turns on a special flag that
  613. causes each line in the EBL program to be printed as it is executed.  Three
  614. '+' (plus) symbols will precede the EBL statement which is printed out as an
  615. aid.  The trace can be turned off at any time by the TRACE(OFF) function.
  616. The various types of traces that can be done are:
  617.  
  618.     ~Trace(Off)~       Turn off program tracing
  619.     ~Trace(Commands)~  Trace only DOS commands
  620.     ~Trace(All)~       Trace all EBL and DOS commands
  621.     ~Trace(Results)~   Trace commands and expression results
  622.     ~Trace(Intermed)~  Trace commands and intermediate results
  623.  
  624. A trace can be active during DOS commands within the EBL program.  In
  625. addition, trace can be enabled/disabled at any time, even in immediate mode.
  626. Once enabled, it will remain in effect until the TRACE(OFF) command is
  627. executed.  Errors, execution of other EBL language files, and even executing
  628. DOS commands will not change the trace mode.
  629. end
  630.       goto -scroll
  631. -opt13
  632. -line1201 %i = 1300
  633. -line1300 %H = "External Functions" | call -header| begtype
  634. External functions give Extended Batch Language additional capabilities.
  635. They are programs that add new commands within the EBL language.  Within
  636. these external functions are helpful routines in writing complex EBL
  637. programs.  Generally, you will be able to write almost all of your EBL
  638. programs without these functions.  Occasionally there may be some special
  639. need for a unique operation that is not part of the commands built into
  640. Extended Batch Language.  This set of external functions can therefore be
  641. added to EBL as needed.
  642.  
  643. To use any of these functions, just enter the name of the external function
  644. package from DOS or put the name of the package within your AUTOEXEC.BAT
  645. file.  Your batch files can then have any of the additional capabilities that
  646. are contained within the function package.
  647. end
  648.     goto -scroll
  649. -line1301 call -header | begtype
  650. ~Built into BAT.COM are the functions:~
  651.  
  652.             CENTER, CHDIR, DATE, GETDIR, KEYPRESSED, LEFT,
  653.             LOWER, LOCATE, RIGHT, STRIP, TIME, UPPER, WHATFUNC,
  654.             SELECT, EDIT, FIELD, INT86, PEEK, POKE, REBOOT
  655.  
  656. ~Provided to registered users only:~
  657.  
  658.   ~BATMATH3~  contains    FLOAT, ABS, FRAC, INT, WHATFUNC
  659.             C2H, D2H, H2C, H2D
  660.  
  661.   ~BATXV~     contains    Extended Variables. Allows almost unlimited
  662.             variable space. Also allows flexible variable
  663.             names, indexing, and array capabilities.
  664.  
  665.   Source code to all external functions is also provided to all registered
  666.   users.
  667. end
  668.       goto -scroll
  669. -line1302 call -header | begtype
  670. A summary of the commands provided within BATFUNC1.COM are:
  671.  
  672.   CENTER( string i [pad] )    - Centers a 'string' within an 'i' field
  673.   CHDIR directory        - Changes sub-directory to 'directory'
  674.   DATE()            - Returns the system date
  675.   GETDIR()            - Returns the current subdirectory
  676.   KEYPRESSED()            - Returns "T" if any key is pressed
  677.   LEFT( string i [pad] )    - Left justifies 'string' within 'i' field
  678.   LOWER( string )        - Returns 'string' in lower case
  679.   LOCATE x y            - Move cursor to new position x y
  680.   RIGHT( string i [pad] )    - Right justifies 'string' within 'i' field
  681.   STRIP( string [type [char]] ) - Removes blanks or 'char' from 'string'
  682.   TIME()            - Returns the system time
  683.   UPPER( string )        - Returns 'string' in upper case
  684.   WHATFUNC()            - Returns the names of the functions loaded
  685.  
  686. Complete details of each function, including examples, can be found in the
  687. Extended Batch Language PLUS Users Guide.
  688. end
  689.       goto -scroll
  690. -line1399 %i = 1303
  691. -line1303 call -header | begtype
  692. These functions can be used any place a variable or other values can be used.
  693. For instance, they can be used in an expression:
  694.  
  695.     %A = LEFT( %B, 8 )
  696.  
  697. They can be used in a condition statement:
  698.  
  699.     If KEYPRESSED() then goto -Had.Key
  700.  
  701. Or they can be used in combination with each other:
  702.  
  703.     Type "The hour is now:" LEFT( TIME() 2 )
  704.  
  705. In general, external functions can be very powerful additions to Extended
  706. Batch Language.  Registered users receive details of how to add their own
  707. custom additions using external functions.  The BAT-BBS will be the
  708. repository for all new functions from other users.
  709. end
  710.       goto -scroll
  711. -opt14
  712. -line1304 %i = 1400
  713. -line1400 %H = "Additional Information" | call -header| begtype
  714. The size of the keyboard stack defaults to 1024 bytes.    This value can be
  715. changed by making the first statement which is executed by the Extended Batch
  716. Language program be of the form:  BAT * size.  Size is the decimal number of
  717. bytes to reserve for the stack.  This must be executed, for instance, when a
  718. system reset is performed because once this area is installed, the size is
  719. never altered until another system reset.
  720.  
  721. There are additional variables %A thru %O (oh) which are called "global user
  722. variables".  These variables are used exactly like the variables supplied by
  723. DOS (%0 to %9) with two exceptions.  First, the contents of these variables
  724. are maintained between execution of batch files for as long as the system is
  725. powered on.  This "global" feature is useful for keeping indicators BETWEEN
  726. "sessions" of the user.  Second, because DOS does not know about these
  727. variables, they~cannot~ be used as variables within any DOS command.  So
  728. while "COPY %1 %2" is valid, "COPY %A %B" is not.  If you wish to use them
  729. within DOS commands, they must first be copied via a statement like
  730. "BAT %1 = %A".
  731. end
  732.       goto -scroll
  733. -line1401 call -header | begtype
  734.   PREDEFINED VARIABLES...
  735.  
  736. A return code is available at memory address [0000:04FE].  If set by a
  737. program, EBL can read this byte value with the variable %R.  The string
  738. stored into this variable is in hex with leading zeros truncated.
  739.  
  740. The current default drive is stored into the %V variable.  It is a single
  741. character.
  742.  
  743. The status of the stack is stored into the %Q variable.  It is a "K" if the
  744. READ command will be reading from the keyboard, and a "S" if it will be
  745. reading from the stack area.
  746.  
  747. There are two character literals.  %S represents a space literal and %%
  748. represents a percent sign.  Either of these special variables can be stored
  749. into other variables, or used for testing special cases.
  750. end
  751.       goto -scroll
  752. -line1402 call -header | begtype
  753. The DIR() function will search any disk drive for the existence of a file.
  754. The operand of the DIR() function can be a specific name, general name with
  755. wildcard characters (e.g. *.EXE), or it can be a name with a specific drive
  756. and path specification (e.g. A:\\EDITOR\\PE.EXE).  If the file exists, this
  757. function will return the file~name~, otherwise it returns nothing.
  758.  
  759. With DIR() you can request other types of information such as:
  760.  
  761.     ~DIR( filename, I)~    - Index to next matching file name
  762.     ~DIR( filename, A)~    - file Attributes
  763.     ~DIR( filename, D)~    - file Date
  764.     ~DIR( filename, T)~    - file Time
  765.     ~DIR( filename, S)~    - file Size
  766.     ~DIR( filename, N)~    - file Name
  767.     ~DIR( filename, P)~    - Position of file within DOS directory
  768.     ~DIR( position, R)~    - Return to Index position
  769. end
  770.       goto -scroll
  771. -line1403 call -header | begtype
  772.   If a you wish to put more than one command on a line, the vertical bar
  773. "|" is useful.  When used with an IF command and the test for the IF
  774. conditions fail, the entire rest of the line will be ignored.  Multiple
  775. commands within a EBL statement is very useful when combined with the IF
  776. command.  For example:
  777.  
  778.     IF %A = abc TYPE this | CALL -that | GOTO -other
  779.  
  780.   If a comment is needed within an EBL program, the "*" (star) character is
  781. useful.  When used after the word EBL, all characters which follow will be
  782. ignored.  For example:
  783.  
  784.     * This is a comment to the programmer.
  785. end
  786.       goto -scroll
  787. -line1404 call -header | begtype
  788. If you still need more information, you might wish to call the BAT-BBS
  789. hotline at 407/395-2816.  Please consult section 3 of this document for
  790. further information on how to do this.
  791.  
  792. Fully registered users will receive a password to the BAT-BBS hot-line to
  793. allow them to get updates, ask questions, and get helpful tips and
  794. examples.  You will also receive many EBL extensions including source code,
  795. examples and samples of all kinds.  In addition, the manual you receive
  796. gives complete descriptions on all available commands with examples of
  797. each.  We feel that user supported software should be a two way street.
  798. With your help, it will work.
  799.  
  800. If you find this program of value, you may purchase it for $79 at the
  801. address below.    For further information, see section 2 of this document.
  802.  
  803.  Seaware Corp.                              407/392-2046
  804.  Post Office Box 1656                          800/634-8188
  805.  Delray Beach, FL 33444
  806. end
  807.     goto -scroll
  808.  
  809. -on.error-
  810.     %e = %e + 1 | if %e > 2 then %L = ? | skip 4
  811.     if %R <> 6 then skip 7
  812.     %G = .goto.
  813.     color 8f |type "Loading part 1 ..."
  814.     leave
  815.     batdoc
  816. bat *
  817. bat beep type "ERROR! BATDOC.BAT overlay is missing!"
  818. bat exit
  819.  
  820. begtype
  821.  
  822.      Unexpected error \%S%R in line \%S%L !
  823.  
  824.      This batch file was error free when it was distributed
  825.      by Seaware. An error indicates that it was most likely
  826.      modified by someone improperly. To get an updated demo
  827.      diskette send $10 to Seaware directly or call 800/634-8188
  828.      or 407/392-2046.
  829.  
  830.  
  831.             Seaware Corp.
  832.              Post Office Box 1656
  833.             Delray Beach, FL 33444
  834. end
  835. %G =
  836. %E = 0
  837. exit
  838.